#! /usr/bin/env python
# -*- coding:utf8 -*-
# vim: ts=8 tw=4 sts=4 et
import wx
import os

class MainPanel(wx.Panel):
    def __init__(self, parent):
        wx.Panel.__init__(self, parent)

        testListCtrl = wx.ListCtrl(self, -1, style = wx.LC_REPORT| wx.LC_SINGLE_SEL )
        testListCtrl.InsertColumn(0, "name")
        testListCtrl.InsertColumn(1, "info")
        testListCtrl.SetColumnWidth(0, 100)
        testListCtrl.SetColumnWidth(1, 200)

        index = testListCtrl.InsertStringItem(0, "first")
        testListCtrl.SetStringItem(index, 1, "first_info")

        index = testListCtrl.InsertStringItem(1, "second")
        testListCtrl.SetStringItem(index, 1, "second_info")

        sizer = wx.BoxSizer(wx.VERTICAL)
        sizer.Add(testListCtrl, 1, wx.ALL|wx.EXPAND, 5)
        self.SetSizer(sizer)

    
class MainFrame(wx.Frame):
    def __init__(self, parent, title):
        wx.Frame.__init__(self, parent, -1, title)
        self.CentreOnScreen(wx.BOTH)
        panel = MainPanel(self)
        panel.Layout()

class MainApp(wx.App):
    def OnInit(self):
        frame = MainFrame(None, "Main Frame")
        frame.Show()
        self.SetTopWindow(frame)
        return True

    def OnExit(self):
        pass

if __name__ == "__main__":
    MainApp(redirect=False).MainLoop()
